﻿using Easy.Services.Entities;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;

namespace Easy.Services.Config
{
    internal class CompanyConfig : IEntityTypeConfiguration<Company>
    {
        public void Configure(EntityTypeBuilder<Company> builder)
        {
            builder.ToTable(nameof(Company));

            builder.Property(r => r.CreaterDate);
            builder.Property(r => r.CreaterId).IsRequired(false);
            builder.Property(r => r.CreaterName).HasMaxLength(50).IsRequired(false);
            builder.Property(r => r.EditDate).IsRequired(false);
            builder.Property(r => r.EditId).IsRequired(false);
            builder.Property(r => r.EditName).HasMaxLength(50).IsRequired(false);
            builder.Property(r => r.IsDelete).IsRequired(false);

            builder.Property(r => r.Name).HasMaxLength(100).IsRequired(false);
            builder.Property(r => r.Code).HasMaxLength(100).IsRequired(false);
            builder.Property(r => r.Introduce).HasMaxLength(100).IsRequired(false);
            builder.Property(r => r.ManagerId).IsRequired(false);
            builder.Property(r => r.ManagerName).HasMaxLength(100).IsRequired(false);
            builder.Property(r => r.Pid).IsRequired(false);


        }
    }
}